﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 观测者模式_双向耦合代码
{
    class Program
    {
        static void Main(string[] args)
        {
            Secretary tongzizhe = new Secretary();
            StockObserver tongshi1 = new StockObserver("张3", tongzizhe);
            StockObserver tongshi2 = new StockObserver("李4", tongzizhe);

            tongzizhe.Append(tongshi1);
            tongzizhe.Append(tongshi2);

            tongzizhe.SecretaryAction = "老板回来了";
            tongzizhe.Notify();
        }
    }
}
